#打印100以内的数字
for i in range(1,101):
    print(i)
    if i%3==0:
        print("Fizz")
    elif i%5==0:
        print("Buzz")
    else:
        print(i)
        # 单行注释
        """
        多行注释
        """
        if True:
            print("True")
        else:
            print("False")
        str = "123456789"
        num = 10 + 20
        str1 = '''
        1
        2
        3
        4
        5
        '''
        print(str1)
        str2 = 100
        print(type(str1))  # <class 'str'>
        print(type(str2))  # <class 'int'>
        str3 = [1, 3, "hello"]
        print(str3)
        num1 = int(input("请输入第一个数字"));  # 返回类型是str
        num2 = int(input("请输入第二个数字"));
        print(num1 + num2)
        num1 = float(input("enter num1:"))
        num2 = float(input("enter num2:"))
        op = input("enter op:")
        if op == "+":
            print(num1 + num2)
        elif op == "-":
            print(num1 - num2)
        elif op == "*":
            print(num1 * num2)
        elif op == "/":
            print(num1 / num2)
        else:
            print("输入错误")


            # 打印菱形
        from random import randint

        for i in range(1, 10):
                print(" " * (10 - i) + "*" * (i + i - 1))
        for j in range(10, 1, -1):
                print(" " * (10 - j) + "*" * (j + j - 1))
            # 打印九九乘法表
        for i in range(1, 10):
         for j in range(1, i + 1):
                    print("%d*%d=%d" % (j, i, i * j), end="\t")
        print()

            # 打印水仙花数
        for i in range(100, 1000):
                ge = i % 10
                shi = i // 10 % 10
                bai = i // 100
        if i == ge ** 3 + shi ** 3 + bai ** 3:
                    print(i)


            # 打印斐波那契数列
        def fib(n):
             if n <= 2:
                return 1
             return fib(n - 1) + fib(n - 2)


        for i in range(1, 10):
                print(fib(i))


            # 打印100以内的质数
        def isprime(n):
             for i in range(2, n):
                 if n % i == 0:
                     return False
             return True


        for i in range(1, 100):
                if isprime(i):
                    print(i)
            # 打印100以内的完数
        for i in range(1, 101):
             sum = 0
        for j in range(1, i):
                 if i % j == 0:
                    sum += j
        if sum == i:
         print(i, end="\t")
         print()
            # 打印100以内能被3和7整除的数

        for i in range(1, 100):
            if i % 3 == 0 and i % 7 == 0:
             print(i, end="\t")
            # 猜数字
            # 产生随机数
            num = randint(1, 30)
            print(num)
            while True:
                guess = int(input("请输入一个数字:"))
                if (guess > num):
                    print("太大了")
                elif (guess < num):
                    print("太小了")
                else:
                    print("猜对了")
                    break  # 结束循环



